Equivalence in Functional Languages with Eeects

نویسندگان

  • Ian Mason
  • Carolyn Talcott
چکیده

Traditionally the view has been that direct expression of control and store mechanisms and clear mathematical semantics are incompatible requirements. This paper shows that adding objects with memory to the call-by-value lambda calculus results in a language with a rich equational theory, satisfying many of the usual laws. Combined with other recent work this provides evidence that expressive, mathematically clean programming languages are indeed possible. 1. Overview Real programs have eeects|creating new structures, examining and modifying existing structures, altering ow of control, etc. Such facilities are important not only for optimization, but also for communication, clarity, and simplicity in programming. Thus it is important to be able to reason both informally and formally about programs with eeects, and not to sweep eeects either to the side or under the store parameter rug. Recent work of Talcott, Mason, Felleisen, and Moggi establishes a mathematical foundation for studying notions of program equivalence for programming languages with function and control abstractions operating on objects with memory. This work extends work of Landin, Reynolds, Morris and Plotkin. Landin 14] and Reynolds 35] describe high-level abstract machines for deening language semantics. Morris 29] deenes an extensional equivalence relation for the classical lambda calculus. Plotkin 33] extends these ideas to the call-by-value lambda calculus and deenes the operational equivalence relation. Operational approximation is the pre-ordering induced by an operational semantics. Operational equivalence is the equivalence naturally associated with this pre-ordering. One expression operationally approximates another if for all closing program contexts either the rst expression is undeened or both expressions are deened and their values are indistinguishable (with respect to some primitive means of testing equality). Operational approximation and equivalence are congruence relations on expressions and hence closed under substitution and abstraction. Mason and Talcott in 39, 17, 18, 40] study operational approximation and equivalence for subsets of a language with function and control abstractions and objects with memory. Felleisen 8] deenes reduction calculi extending the call-by-value lambda calculus to languages with control and assignment abstractions. These calculi are simpliied and extended by Felleisen and Hieb in 9]. Talcott, Mason, and Felleisen all apply their theories to expressing and proving properties of program constructs and of particular programs. Moggi 27, 28] introduces the notion of computational monad as a framework for axiomatizing features of programming languages. Computational monads are categories with certain additional structure that accommodate a wide variety of language features including assignment, exceptions, and …

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Equivalence in Functional Languages with Effects

Traditionally the view has been that direct expression of control and store mechanisms and clear mathematical semantics are incompatible requirements. This paper shows that adding objects with memory to the call-by-value lambda calculus results in a language with a rich equational theory, satisfying many of the usual laws. Combined with other recent work this provides evidence that expressive, ...

متن کامل

Delimiting the Scope of Eeects

Program fragments in functional languages may be observationally congruent in a language without eeects (continuations, state, exceptions) but not in an extension with eeects. We give a generic way to preserve pure functional congruences by means of an eeects delimiter. The eeects delimiter is deened semantically using the retraction techniques of 14], but can also be given an operational seman...

متن کامل

Encapsulated Eeects

Side eeects in imperative programming languages are ubiquitous, which makes it dii-cult to reason about programs in other than operational terms. Functional programming languages, on the other hand, claim the advantage that equational logics are suucient for reasoning, but at the that often useful eeects, such as interactive input, exceptions, and explicit updates of state cannot be accommodate...

متن کامل

Towards Algebras of Encapsulated Eeects

Side eeects in imperative programming languages are ubiquitous, which makes it diicult to reason about programs in other than operational terms. Functional programming languages, on the other hand, claim the advantage that equational logics are suucient for reasoning , but at the price that useful eeects, such as interactive input, exceptions, and explicit updates of state cannot be accommodate...

متن کامل

A Variable Typed Logic of E ects

In this paper we introduce a variable typed logic of eeects inspired by the variable type systems of Feferman for purely functional languages. VTLoE (Variable Typed Logic of EEects) is introduced in two stages. The rst stage is the rst-order theory of individuals built on assertions of equality (operational equivalence a la Plotkin), and contextual assertions. The second stage extends the logic...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007